<script>
lang.module_title = '模型名称'; 
lang.module_name = '模型表名'; 
</script>

<!--编辑友情链接分类-->
<div class="dialog_content">
	<form id="info_form" name="info_form" action="{:u('module/edit')}" method="post">
	<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
		<tr>
			<th width="80"><font color="red">*</font>模型名称 :</th>
			<td><input type="text" name="title" id="title" class="input-text" value="{$rs('title')}"></td>
		</tr>
		<tr>
			<th width="80"><font color="red">*</font>模型表名 :</th>
			<td><input type="text" name="name" id="name" class="input-text" value="{$rs('name')}"></td>
		</tr>
		<tr>
			<th width="80">调用字段 :</th>
			<td><input type="text" name="fields" id="fields" class="input-text" style="width:300px" value="{$rs('fields')}"></td>
		</tr>
		<tr>
			<th width="80">模型简介 :</th>
			<td><textarea id="remark" name="remark" rows="4" cols="50">{$rs('remark')}</textarea></td>
		</tr>
		<tr>
			<th>{:L('enabled')} :</th>
			<td>
				<label><input type="radio" name="status" class="radio_style" value="1" {if rs('status')=1} checked="checked"{/if}> &nbsp;{:L('yes')}&nbsp;&nbsp;&nbsp;</label>
				<label><input type="radio" name="status" class="radio_style" value="0" {if rs('status')=0} checked="checked"{/if}> &nbsp;{:L('no')}</label>
			</td>
		</tr>
	</table>
	<input type="hidden" name="id" value="{$rs('id')}" />
	</form>
</div>

<script>
var check_name_url = "{:U('module/ajax_check_name?id=' & rs('id') )}";
$(function(){
	$("#title").formValidator({onshow:lang.please_input+lang.module_title,onfocus:lang.please_input+lang.module_title}).inputValidator({min:1,onerror:lang.please_input+lang.module_title});
	$("#name").formValidator({onshow:lang.please_input+lang.module_name,onfocus:lang.please_input+lang.module_name}).inputValidator({min:1,onerror:lang.please_input+lang.module_name}).ajaxValidator({
	    type : "get",
		url : check_name_url,
		datatype : "json",
		async:'false',
		success : function(result){	
            if(result.status == 0){
                return false;
			}else{
                return true;
			}
		},
		onerror : lang.module_already_exists,
		onwait : lang.connecting_please_wait
	}).defaultPassed();
});
</script>